package com.axend.aerosense.user.fragment;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.axend.aerosense.base.fragment.MvvmBaseFragment;
import com.axend.aerosense.base.viewmodel.BaseViewModel;
import com.axend.aerosense.common.UrlApi;
import com.axend.aerosense.user.R;
import com.axend.aerosense.user.UserSettingActivity;
import com.axend.aerosense.user.databinding.UserFragmentUserAgreementBinding;


/**
 * @author ChenHongWei
 * @date :2020/12/28 16:*/

public class UserAgreementFragment
        extends MvvmBaseFragment<UserFragmentUserAgreementBinding, BaseViewModel> {

    private String url = UrlApi.userProtocolUrl;

    public static UserAgreementFragment getInstance(){
        return new UserAgreementFragment();
    }

    @Override
    public void onResume() {
        super.onResume();
        ((UserSettingActivity)getActivity()).setTitle(getString(R.string.user_title_user_agreement));
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        viewDataBinding.loginWebView.getSettings().setDefaultTextEncodingName("UTF-8") ;
        viewDataBinding.loginWebView.loadUrl(url);
    }

    @Override
    public int getLayoutId() {
        return R.layout.user_fragment_user_agreement;
    }

    @Override
    public int getBindingVariable() {
        return 0;
    }

    @Override
    protected BaseViewModel getViewModel() {
        return null;
    }

    @Override
    protected void onRetryBtnClick() {

    }
}
